package com.gee.spring.boot.influxdb.core.convertor;

import com.gee.spring.boot.influxdb.core.util.HexUtil;
import org.springframework.stereotype.Component;

/**
 * @author gepengjun
 * @since 2024/4/24 14:05
 */
public class BytesHexConvertor implements Convertor<byte[], String> {

    @Override
    public byte[] toJavaValue(String hexData) {
        return HexUtil.decodeHexStr(hexData);
    }

    @Override
    public String toSaveValue(byte[] data) {
        return HexUtil.encodeHexStr(data);
    }
}
